package com.example.bzh.gamecat.ui.society.babysociety;

import com.example.bzh.gamecat.bean.SocietyAllPlayBean;
import com.example.bzh.gamecat.bean.SocietyBabyBean;
import com.example.bzh.gamecat.httputils.societyutils.SocietyBabyHttpUtil;

import java.util.HashMap;

/**
 * Created by MyPC on 2016/8/16.
 */
public class SocietyBabyPresenter implements SocietyBabyContract.IPresenter {

    private SocietyBabyContract.IModel iModel;
    private SocietyBabyContract.IView iView;

    public SocietyBabyPresenter(SocietyBabyContract.IView iView, SocietyBabyContract.IModel iModel){
        this.iView = iView;
        this.iModel = iModel;
    }

    @Override
    public void initData(HashMap<String, String> params) {
        iModel.getSocietyBaby(params, new SocietyBabyHttpUtil.HttpCallBack<SocietyBabyBean>(){
            @Override
            public void onSucess(SocietyBabyBean societyBabyBean) {
                iView.OnSeccessSocietyBaby(societyBabyBean);
            }

            @Override
            public void onFail() {
                iView.OnFailSocietyBaby("数据加载失败......");
            }
        });
    }
}
